home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 / Ham Radio 2000.iso / ham2000 / packet / aprs75c / summariz.bas < prev    next >
BASIC Source File  |  1995-04-06  |  7KB  |  162 lines

  1.  REM Ver 6.7b
  2.  CLS
  3.  PRINT "This program will search through all new backup and/or all history files"
  4.  PRINT "to extract the latest position of each station.  It outputs these summaries"
  5.  PRINT "to the ALLBAKS.hst and ALLHSTS.hst files."
  6.  PRINT
  7.  PRINT "These files are saved as HISTORY files.  This is so that they"
  8.  PRINT "can be REPLAYED at any time to find out where someone is without"
  9.  PRINT "destroying data on the P or L list."
  10.  PRINT
  11.  PRINT "To use them, just select FILE-REPLAY and after selecting the ALLBAKS.hst or"
  12.  PRINT "the ALLHSTS.hst file, then select the callsign of the station you are looking"
  13.  PRINT "for.  If that station is in the file, APRS will draw the map with that"
  14.  PRINT "station on it."
  15.  PRINT
  16.  PRINT "Or you can use these files to see everyone in a given area.  Just choose"
  17.  PRINT "the map area you are interested in, and replay the file.  Every call in "
  18.  PRINT "the file that is in that area will appear on the map!"
  19.  PRINT
  20.  LOCATE 25, 1: INPUT "Hit ENTER to continue..."; a$
  21.  CLS
  22.  PRINT "Once you run this program ONCE, it saves the two summary files in your HSTS"
  23.  PRINT "Directory where you can find it easliy.  From then on, whenever you want to "
  24.  PRINT "clean up your normal APRS\HSTS directory, just run this program instead of "
  25.  PRINT "just deleting all the old TKxxxxx.HST files.  Unless told otherwise, this"
  26.  PRINT "program will look through all new TKxxxxx.HST files and combine any new calls"
  27.  PRINT "with the existing ALLHSTS.HST or ALLBAKS.HST files."
  28.  PRINT
  29.  PRINT "Once this is done, you can delete all of the old TKxxxxx.HST files if"
  30.  PRINT "you no longer need them."
  31.  PRINT
  32.  DIM P$(800)
  33.  
  34.  INPUT "Search all BK (B) or HST files (H)"; a$
  35.  IF LEFT$(UCASE$(a$), 1) = "B" THEN GOTO BAKS
  36.  
  37. HSTS: HSTpath$ = "\APRS\HSTS"
  38.   PRINT "Enter path to your APRS\HSTS directory if not "; HSTpath$;
  39.   INPUT a$: IF a$ <> "" THEN HSTpath$ = a$
  40.   INPUT "Search ALL files or just new TK files (T)"; Ans$: Ans$ = UCASE$(Ans$)
  41.      
  42.   SHELL "dir " + HSTpath$ + " >temp.hst"
  43.      
  44.   OPEN "temp.hst" FOR INPUT AS #1
  45.   DO UNTIL EOF(1)
  46.      LINE INPUT #1, a$: REM PRINT a$
  47.      IF LEN(a$) > 38 AND LEFT$(a$, 1) <> "." AND LEFT$(a$, 1) <> " " THEN
  48.         IF Ans$ = "A" OR LEFT$(a$, 2) = "TK" OR LEFT$(a$, 7) = "ALLHSTS" THEN
  49.            F$ = LEFT$(a$, 8) + "." + MID$(a$, 10, 3)
  50.            LOCATE 24, 1: PRINT "Opening "; F$
  51.            OPEN HSTpath$ + "\" + F$ FOR INPUT AS #2
  52.            GOSUB Do25th
  53.            IF INKEY$ = CHR$(27) THEN EXIT DO
  54.            DO UNTIL EOF(2)
  55.               LINE INPUT #2, a$
  56.               PRINT ".";
  57.               IF LEN(a$) > 40 THEN
  58.                  NxPosC$ = MID$(a$, 1, 9)
  59.                  NxPosT$ = MID$(a$, 19, 6)
  60.                  REM PRINT LEFT$("        Found " + a$, 79)
  61.                  Haveit = 0
  62.                  FOR i = 1 TO NumPos
  63.                      IF NxPosC$ = LEFT$(P$(i), 9) THEN
  64.                         Haveit = -1
  65.                         REM now compare times
  66.                         IF NxPosT$ > MID$(P$(i), 12, 6) THEN 'it is later so swap
  67.                            P$(i) = a$: LOCATE 24, 1
  68.                            PRINT LEFT$("      NEWER POSIT: " + P$(i), 79)
  69.                            GOSUB Do25th
  70.                         END IF 'if it was newer
  71.                      END IF' if it is the same callsign
  72.                  NEXT i ' compare to all existing P$(i)
  73.                  IF Haveit = 0 THEN
  74.                     NumPos = NumPos + 1
  75.                     P$(NumPos) = a$: LOCATE 24, 1
  76.                     PRINT NumPos; LEFT$("      Add pos: " + P$(NumPos), 73)
  77.                     GOSUB Do25th
  78.                  END IF
  79.               END IF' if it was a POSITION (p,)
  80.            LOOP 'read the next line in the BK file
  81.            CLOSE #2 ' Finished all of that file
  82.         END IF 'if it was a valid file name
  83.      END IF
  84.   LOOP 'to the next BK file
  85.   CLOSE #1 ' Finished that all files in that directory
  86.  
  87.   F$ = "ALLHSTS.hst"
  88.   PRINT "Enter name of OUTPUT file if other than "; F$;
  89.   INPUT a$: IF a$ <> "" THEN F$ = a$
  90.   OPEN F$ FOR OUTPUT AS #3: PRINT "OPENING OUTPUT FILE..."; F$
  91.   FOR i = 1 TO NumPos: PRINT #3, P$(i): NEXT i
  92.   CLOSE #3
  93.   STOP
  94.     
  95. BAKS: BKpath$ = "\APRS\BAKS"
  96.   PRINT "Enter path to your APRS\BAKS directory if not "; BKpath$;
  97.   INPUT a$: IF a$ <> "" THEN BKpath$ = a$
  98.   SHELL "dir " + BKpath$ + " >temp.bk"
  99.  
  100.   OPEN "temp.bk" FOR INPUT AS #1
  101.   DO UNTIL EOF(1)
  102.      LINE INPUT #1, a$: REM print a$
  103.      IF LEN(a$) > 38 AND LEFT$(a$, 1) <> "." AND LEFT$(a$, 1) <> " " THEN
  104.         IF Ans$ = "A" OR LEFT$(a$, 2) = "BK" OR LEFT$(a$, 7) = "ALLBAKS" THEN
  105.            F$ = LEFT$(a$, 8) + "." + MID$(a$, 10, 3)
  106.            PRINT "Opening "; F$
  107.            OPEN BKpath$ + "\" + F$ FOR INPUT AS #2
  108.            GOSUB Do25th
  109.            DO UNTIL EOF(2)
  110.               LINE INPUT #2, a$
  111.               PRINT ".";
  112.               IF LEFT$(a$, 1) = "p" THEN
  113.                  NxPosC$ = MID$(a$, 3, 9)
  114.                  NxPosT$ = MID$(a$, 21, 6)
  115.                  REM PRINT LEFT$("        Found " + a$, 79)
  116.                  Haveit = 0
  117.                  FOR i = 1 TO NumPos
  118.                      IF NxPosC$ = LEFT$(P$(i), 9) THEN
  119.                         Haveit = -1
  120.                         REM now compare times
  121.                         IF NxPosT$ > MID$(P$(i), 12, 6) THEN 'it is later so swap
  122.                            P$(i) = MID$(a$, 3): LOCATE 24, 1
  123.                            PRINT LEFT$("      NEWER POSIT: " + P$(i), 79)
  124.                            GOSUB Do25th
  125.                         END IF 'if it was newer
  126.                      END IF' if it is the same callsign
  127.                  NEXT i ' compare to all existing P$(i)
  128.                  IF Haveit = 0 THEN
  129.                     NumPos = NumPos + 1
  130.                     P$(NumPos) = MID$(a$, 3): LOCATE 24, 1
  131.                     PRINT NumPos; LEFT$("      Add pos: " + P$(NumPos), 73)
  132.                     GOSUB Do25th
  133.                  END IF
  134.               END IF' if it was a POSITION (p,)
  135.            LOOP 'read the next line in the BK file
  136.            CLOSE #2 ' Finished all of that file
  137.         END IF 'if it was a valid file name
  138.      END IF
  139.   LOOP 'to the next BK file
  140.   CLOSE #1 ' Finished all files in that directory
  141.  
  142.   F$ = "ALLBAKS.hst"
  143.   PRINT "Enter output file if other than "; F$;
  144.   INPUT a$: IF a$ <> "" THEN F$ = a$
  145.   OPEN F$ FOR OUTPUT AS #3: PRINT "OPENING OUTPUT FILE..."; F$
  146.   FOR i = 1 TO NumPos: PRINT #3, P$(i): NEXT i
  147.   CLOSE #3
  148.   STOP
  149.  
  150. Do25th: LOCATE 25, 1: PRINT SPACE$(80);
  151.         LOCATE 25, 1
  152.         RETURN
  153.  
  154.  
  155.   END
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.